package com.sgy.springboot_demo.service;

import com.sgy.springboot_demo.mapper.ProductMapper;
import com.sgy.springboot_demo.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

// 标识该类是一个服务类
@Service
public class ProductService {

    // 注入ProductMapper类
    @Autowired
    private ProductMapper productMapper;

    // 调用ProductMapper类的findAllProductM方法
    public void findAllProductM() {
        List<Product> allProductM = productMapper.findAllProductM();
        System.out.println(allProductM);
    }

    // 调用ProductMapper类的findAllProductS方法
    public void findAllProductS() {
        List<Product> allProductS = productMapper.findAllProductS();
        System.out.println(allProductS);
    }
}
